package Int

import (
	"errors"
	"fmt"
	"strconv"
)

type Int int

func (data Int)Get转换小数(除于几 int)(float64,error)  {
	var val64 float64
	var err error
	if 除于几!=0 {
		val64, err = strconv.ParseFloat(fmt.Sprintf("%.2f", float64(data)/float64(除于几)), 64)
	}else {
		val64, err = strconv.ParseFloat(fmt.Sprintf("%.2f", float64(data)), 64)
	}
	if err != nil {
		return 0, errors.New("转换失败")
	}
	return val64,nil
}
